﻿@{
    ViewBag.Title = "ChengGong_TouZi";
    Layout = "~/Views/Shared/MyAccount.cshtml";
}

<script>
        $(function () {
            Page(1);
        });
        var counttt;
        function Page(i) {
            $.getJSON("/InvestGuanLi/ChengGong_Get", { toubiaostartime: "2015-8-8", toubiaoend: "2015-8-8", pageindex: i, pagesize: 2 }, function (data) {

                var str = "<tr class=''><th style='width:150px;'>编号</th><th style='width:120px;'>借款标题</th><th style='width:100px;'>借款金额</th><th style='width:110px;'>预计收益</th><th style='width:150px;'>实际收益</th><th style=' width:90px;'>类型</th></tr>";

                for (var i = 0; i < data.Data.length; i++) {

                    str += "<tr class=''><td style='width:150px;'>" + data.Data[i].MemInvestId + "</td><td style='width:120px;'>" + data.Data[i].Title + "</td><td style='width:100px;'>" + data.Data[i].LoanMoney + "</td><td style='width:110px;'>" + data.Data[i].CollectIncome + "</td><td style='width:150px;'>" + data.Data[i].Annualrate + "</td><td style=' width:90px;'>" + data.Data[i].LoanType + "</td></tr>";
                }
                $("#tables").html(str);
                counttt = data.PageCount;
                var tas = "<tr style='background-color:#eddede';><td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<span> 共<label id='sums'>" + data.PageCount + "</label>  页 &nbsp&nbsp&nbsp&nbsp当前第 <label id='index'>" + data.PageIndex + "</label> 页&nbsp&nbsp&nbsp&nbsp <a onclick='Page(1)'>首页</a>&nbsp&nbsp&nbsp&nbsp";
                //判断当前页是否为1，如果不是那就减一如果是那就直接定到第一页
                if (data.PageIndex <= 1) {
                    tas += ("<a  onclick='Page(1)'  >上一页</a>&nbsp&nbsp&nbsp&nbsp");
                }
                else {
                    tas += ("<a  onclick='Page(" + (data.PageIndex - 1) + ")'  >上一页</a>&nbsp&nbsp&nbsp&nbsp");
                }
                //判断是否为最后一页。如果不是那就加一如果是那就直接定到最后一页
                if (data.PageIndex >= data.PageCount) {
                    tas += "<a  onclick='Page(" + (data.PageCount) + ")' >下一页</a>&nbsp&nbsp&nbsp&nbsp";
                } else {
                    tas += "<a  onclick='Page(" + (data.PageIndex + 1) + ")' >下一页</a>&nbsp&nbsp&nbsp&nbsp";
                }
                tas += " <a onclick='Page(" + data.PageCount + ")'>尾页</a>&nbsp&nbsp&nbsp&nbsp";
                //跳转页
                tas += "转到<input id='pageas' style='width:50px' type='text' /><input id='Button1' type='button'  onclick='tiaozhuan()'  value='确定' /></span></td> </tr>";
                $("#tass").html(tas);
            });
        };
        //跳转分页
        function tiaozhuan() {
            var idd = $("#pageas").val();
            if (idd > counttt) {
                alert("您输入的页数到达极限！为您跳转到尾页");
                Page(counttt);
            } else {
                Page(idd);
            }
        };
</script>
<div class="MyTabMuen">
    <ul>
        <li class="curt"><a href="#">正在投标的借款</a><span></span></li>
    </ul>
    <form method="post">
        <div  class="my_Search">
            @*<ul>
                <li>
                    <span style="margin-top: 7px;" class="lf">
                        投标时间：
                        <input id="Text1" value="2017-03-13" type="date" /> -
                        <input type="date" value="2017-03-13" />
                    </span>
                    <span class="lf"><input style="margin-top: 15px;" type="button" value="搜 索" class="Flat_but" id="Search"></span>

                </li>
            </ul>*@
            <div class="clear"></div>
        </div>
    
            <table cellspacing="0" id="tables" cellpadding="0" class="table_list" style=" width:920px; font-size:12px;">
                
            </table>
        <table id="tass"></table>
    </form>
    <div class="Result_tj" id="resultCounts">
        <span >结果统计：借出总额<b class="red" id="detailCount1">￥0.00</b></span>
        <span>应收利息总额<b class="red" id="detailCount2">￥0.00</b><img src="https://style.my089.com/pc/resources/myacc_img/tip1.png" /></span>
        <span>待收本金总额<b class="red" id="detailCount3">￥0.00</b></span>
        <span>待收利息总额<b class="red" id="detailCount4">￥0.00</b><img src="https://style.my089.com/pc/resources/myacc_img/tip1.png" /></span>
    </div>

    <div class="clear"></div>
</div>


<div class="Biding">
    
    

</div>


